/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2019-2023. All rights reserved.
 * Description: add fma_no_pgfault to avoid page fault
 * Author: Zhiqiang Liu
 * Create: 2019-06-29
 */

#ifdef CONFIG_EULEROS_FMA_NO_PGFAULT
#include <linux/string.h>
#include <linux/printk.h>
#include <linux/errno.h>

int __fma_no_pgfault __read_mostly;

static int __init parse_fma_no_pgfault(char *arg)
{
	if (!arg)
		return -EINVAL;

	if (!strcasecmp(arg, "0"))
		__fma_no_pgfault = 0;
	else if (!strcasecmp(arg, "1"))
		__fma_no_pgfault = 1;

	pr_info("fma_no_pgfault: %d\n", __fma_no_pgfault);
	return 0;
}
early_param("fma_no_pgfault", parse_fma_no_pgfault);
#endif
